package com.fyy.netty.chapter01.c2;

import java.io.IOException;
import java.net.InetSocketAddress;
import java.nio.channels.SocketChannel;
import java.nio.charset.StandardCharsets;

/**
 * @Author fyy
 * @Description
 * @Date 2021/4/21 14:36
 */
public class Client {

    public static void main(String[] args) throws IOException, InterruptedException {
        SocketChannel sc = SocketChannel.open();
        sc.connect(new InetSocketAddress("127.0.0.1",8080));
        while (true){
            sc.write(StandardCharsets.UTF_8.encode("1"));
            Thread.sleep(1000);
        }
    }

}
